<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for循环语句</title>
    <script type="text/javascript">

        /*
        for(var i=0;i<10;i++){
            alert(i);
        }
        */

        /*
        var sum = 0;
        for (var i = 0; i <= 100; i++) {
        
            if (i % 2 != 0) {
                console.log(i);
                sum=sum+i;
            }
        
        }
        console.log("sum="+sum)
        */

        /*
        var count=0;
        for ( var i = 0 ,sum = 0; i <= 100 ; i++ ){
            if( i % 7 ==0 ) {
                sum = sum + i ;
                count++;
            }
        }
        console.log("sum="+sum);
        console.log("count="+count);
        */

        for(var i=100;i<1000;i++){

            var bai = parseInt (i/100);

            var shi = parseInt ((i-bai*100)/10);

            var ge = i % 10 ;

            if (bai*bai*bai + shi*shi*shi + ge*ge*ge == i){
                console.log(i);
            }

            
        }



    </script>

</head>

<body>
</body>

</html>